
#ifndef _BASE64_H_
#define _BASE64_H_

#define BASE64_NeedCRLF	1
#define BASE64_NotCRLF	0

#ifdef __cplusplus
	extern "C" {
#endif

/***************************************************************
 *
 * Input
 *     bin_data : binary data
 *     bin_size : binary data length
 *     Mode     : operation mode
 *          BASE64_NeedCRLF ---- Need a CRLF every 64 base64-character
 *          BASE64_NotCRLF  ---- Need not CRLF between 64 base64-character
 *
 * Output
 *     char data
 *     char data length
 *
 * Return
 *     0: success; -1: error
 ***************************************************************/
int base64_encode_new(unsigned char * bin_data, long bin_size, 
	  			     char * base64_data,long * base64_size, int Mode);

/***************************************************************
 *
 * Input
 *     base64_data : char data
 *     base64_size : char data length    
 *
 * Output
 *     binary data
 *     binary data length
 *
 * Return
 *     0: success; -1: base64 data format error
 ***************************************************************/
int base64_decode_new(char *base64_data,long base64_size,
				     unsigned char *bin_data,  long *bin_size);


#ifdef __cplusplus
	}
#endif

#endif


